package dataStructure.chapter04_栈.java1;


import java.util.ArrayList;

/**
 * @author https://gitee.com/W_Jun
 * @date 2022-01-18 14:51
 * @Description 利用继承数组实现栈
 */
public class MyStack<E> extends ArrayList<E> {
    int size = size();
    public void push(E element) {
        add(element);
    }

    public E pop() {
        return remove(size - 1);
    }

    public E top() {
        return get(size - 1);
    }
}
